# 使用for循环输出九九乘法表，左下直角(word第一图)
for j in range(1, 10):
    for i in range(1, j+1):
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
    print()

# ----分隔线----
print("="*78)

# 使用for循环输出九九乘法表，左上直角(word第二图)
for j in range(9, 0, -1):
    for i in range(1, j+1):
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
    print("")
    
# ----分隔线----
print("="*78)
    
# 使用for循环输出九九乘法表，右下直角(word第三图)
for j in range(1, 10):
    for s in range(1, 10-j):
        print(end="         ")
    for i in range(j, 0, -1):
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
    print()

# ----分隔线----
print("="*78)


# 使用for循环输出九九乘法表，右上直角(word第四图)
for j in range(9, 0, -1):
    for s in range(0, 9-j):
        print(end="         ")
    for i in range(j, 0, -1):
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
    print()

# ----分隔线----
print()
print("="*13, "分隔线以上为fox循环实现，分隔线以下为while循环实现", "="*13)
print()

# 使用while循环输出九九乘法表,左下直角(word第一图)
j = 1
while j <= 9:
    i = 1
    while i <= j:
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
        i += 1
    print("")
    j += 1

# ----分隔线----
print("="*78)

# 使用while循环输出九九乘法表，左上直角(word第二图)
j = 9
while j >= 1:
    i = 1
    while i <= j:
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
        i += 1
    print("")
    j -= 1

# ----分隔线----
print("="*78)

# 使用while循环输出九九乘法表,右下直角(word第三图)
j = 1
while j <= 9:
    s = 1
    while s <= 9-j:
        print(end="         ")
        s += 1
    i=j
    while i >= 1:
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
        i -= 1
    print("")
    j += 1

# ----分隔线----
print("="*78)

# 使用while循环输出九九乘法表,右上直角(word第四图)
j = 9
while j >= 1:
    s = 1
    while s <= 9-j:
        print(end="         ")
        s += 1
    i = j
    while i >= 1:
        print("{}*{}={:<4}".format(i, j, i*j), end=" ")
        i -= 1
    print("")
    j -= 1
